#include "Request.h"
#include "WeiboApi.h"


HTTP_RESULTCODE  SyncRequest(const char* pReqUrl,  EHttpMethod eHttpMethod, CWeiboParam oQWBlogParam, char* &pResultData,int &nLen )
{
	std::string strData;
	HTTP_RESULTCODE eErrorCode = CRequest::GetInstance()->SyncRequest(pReqUrl, eHttpMethod, oQWBlogParam, strData);
	
	char* pszData = new char[strData.length()];
	memcpy(pszData,strData.c_str(),strData.length());
	pResultData = pszData;
	nLen = strData.length();
	return eErrorCode;
}

bool  AsyncRequest( const char* pReqUrl, EHttpMethod eHttpMethod,  CWeiboParam oQWBlogParam, VWeiboCallback * pCallback )
{
	return CRequest::GetInstance()->AsyncRequest(pReqUrl, eHttpMethod, oQWBlogParam, pCallback);
}

void  ReleaseData( void* p )
{
   if(p)
     delete []p;
}